package com.tanguy.user.utlis.extend

import java.text.SimpleDateFormat
import java.util.*

/**
 * Created by dab on 2017/11/23 0023 09:40
 */
fun Long.toTimeString(pattern: String): String {
    val f = SimpleDateFormat(pattern, Locale.CHINA)
    return f.format(Date(this))
}

fun Double.toReserveDecimal(digit:Int) :String=String.format(Locale.CHINA, "%.${digit}f", this)